// 自定义右侧详情面板样式
.right-side-detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 500px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInRight 0.3s ease-out;
  transition: all 0.3s ease;
  
  // 全屏状态样式
  &.fullscreen {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3000;
    animation: fadeIn 0.3s ease-out;
  }
  
  .detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(102, 126, 234, 0.15);
    border-bottom: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    position: relative;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    
    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.15) 100%);
      opacity: 0.8;
    }
    
    > * {
      position: relative;
      z-index: 1;
    }
    
    .header-left {
      flex: 0 0 auto;
      
      .back-btn {
        color: #667eea;
        font-size: 16px;
        font-weight: 500;
        padding: 10px 16px;
        border-radius: 8px;
        background: rgba(102, 126, 234, 0.1);
        border: 1px solid rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
        
        &:hover {
          background: rgba(102, 126, 234, 0.2);
          border-color: rgba(102, 126, 234, 0.5);
          transform: translateY(-1px);
        }
      }
    }
    
    .header-center {
      flex: 1;
      text-align: center;
      
      .header-title {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
        color: #667eea;
        text-shadow: 0 1px 2px rgba(102, 126, 234, 0.3);
        letter-spacing: 0.5px;
      }
    }
    
    .header-right {
      flex: 0 0 auto;
      
      .action-btn {
        color: #667eea;
        font-size: 18px;
        padding: 10px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(102, 126, 234, 0.1);
        border: 1px solid rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
        
        &:hover {
          background: rgba(102, 126, 234, 0.2);
          border-color: rgba(102, 126, 234, 0.5);
          transform: translateY(-1px) scale(1.05);
        }
      }
    }
  }
  
  .detail-content {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    
    // 文章大图
    .article-image {
      width: 100%;
      height: 240px;
      overflow: hidden;
      position: relative;
      
      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
        z-index: 1;
      }
      
      .main-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: relative;
        z-index: 0;
      }
    }
    
    // 文章主体
    .article-body {
      padding: 20px;
      background: #fff;
      margin: 16px;
      border-radius: 12px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
      border: 1px solid rgba(102, 126, 234, 0.1);
      
      .article-title {
        margin: 0 0 16px;
        font-size: 20px;
        font-weight: 700;
        line-height: 1.4;
        color: #2c3e50;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
      }
      
      .article-meta {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
        flex-wrap: wrap;
        padding: 12px;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-radius: 8px;
        border: 1px solid #e9ecef;
        
        .category-tag,
        .status-tag {
          border-radius: 16px;
          font-size: 12px;
          padding: 8px 16px;
          font-weight: 500;
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .publish-time {
          color: #6c757d;
          font-size: 13px;
          font-weight: 500;
        }
      }
      
      // 文章详细信息
      .article-info {
        margin-bottom: 20px;
        
        .info-section {
          margin-bottom: 16px;
          padding: 16px;
          background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
          border-radius: 8px;
          border: 1px solid #e9ecef;
          
          .info-title {
            margin: 0 0 12px;
            font-size: 16px;
            font-weight: 600;
            color: #2c3e50;
            border-left: 4px solid #667eea;
            padding-left: 12px;
            background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), transparent);
          }
          
          .info-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
            
            .info-item {
              display: flex;
              align-items: center;
              padding: 8px 0;
              border-bottom: 1px solid rgba(102, 126, 234, 0.1);
              
              &:last-child {
                border-bottom: none;
              }
              
              .info-label {
                font-weight: 600;
                color: #495057;
                min-width: 80px;
                margin-right: 12px;
                font-size: 13px;
              }
              
              .info-value {
                color: #2c3e50;
                font-size: 13px;
                word-break: break-all;
                flex: 1;
              }
            }
          }
        }
      }
      
      .article-content {
        margin-bottom: 20px;
        
        .content-title {
          margin: 0 0 16px;
          font-size: 18px;
          font-weight: 700;
          color: #2c3e50;
          border-left: 4px solid #67c23a;
          padding-left: 12px;
          background: linear-gradient(90deg, rgba(103, 194, 58, 0.05), transparent);
        }
        
        .content-text {
          line-height: 1.8;
          color: #2c3e50;
          font-size: 15px;
          text-align: justify;
          
          // Markdown格式样式
          .markdown-h1 {
            font-size: 24px;
            font-weight: 700;
            color: #2c3e50;
            margin: 24px 0 16px;
            padding: 16px 0 8px;
            border-bottom: 3px solid #667eea;
            border-left: none;
            background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), transparent);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
          }
          
          .markdown-h2 {
            font-size: 20px;
            font-weight: 600;
            color: #34495e;
            margin: 20px 0 12px;
            padding: 12px 0 6px;
            border-bottom: 2px solid #667eea;
            border-left: none;
            background: linear-gradient(90deg, rgba(102, 126, 234, 0.08), transparent);
          }
          
          .markdown-h3 {
            font-size: 18px;
            font-weight: 600;
            color: #34495e;
            margin: 18px 0 10px;
            padding: 8px 0 4px;
            border-left: 4px solid #667eea;
            padding-left: 12px;
            background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), transparent);
          }
          
          .markdown-h4 {
            font-size: 16px;
            font-weight: 600;
            color: #34495e;
            margin: 16px 0 8px;
            padding: 6px 0 3px;
            border-left: 3px solid #667eea;
            padding-left: 10px;
            background: linear-gradient(90deg, rgba(102, 126, 234, 0.03), transparent);
          }
          
          .markdown-paragraph {
            margin: 0 0 16px;
            text-indent: 2em;
            line-height: 1.8;
            color: #2c3e50;
          }
          
          .markdown-bold {
            font-weight: 700;
            color: #2c3e50;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
            padding: 2px 4px;
            border-radius: 3px;
          }
          
          .markdown-italic {
            font-style: italic;
            color: #34495e;
            background: linear-gradient(135deg, rgba(103, 194, 58, 0.1), rgba(102, 126, 234, 0.1));
            padding: 1px 3px;
            border-radius: 2px;
          }
          
          .markdown-inline-code {
            background: linear-gradient(135deg, #f1f3f4 0%, #e9ecef 100%);
            padding: 3px 6px;
            border-radius: 4px;
            font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
            font-size: 13px;
            color: #e83e8c;
            font-weight: 600;
            border: 1px solid #e9ecef;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
          }
          
          .markdown-code-block {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            padding: 16px;
            border-radius: 8px;
            overflow-x: auto;
            border: 1px solid #e9ecef;
            font-size: 13px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            margin: 16px 0;
            
            code {
              background: none;
              padding: 0;
              border: none;
              color: #2c3e50;
              font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
              line-height: 1.5;
            }
          }
          
          .markdown-link {
            color: #667eea;
            text-decoration: none;
            font-weight: 500;
            padding: 2px 4px;
            border-radius: 3px;
            transition: all 0.3s ease;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), transparent);
            
            &:hover {
              color: #5a6fd8;
              background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.1));
              text-decoration: underline;
              transform: translateY(-1px);
            }
          }
          
          .markdown-image-link {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 16px;
            margin: 16px 0;
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border: 2px dashed #667eea;
            border-radius: 8px;
            color: #667eea;
            font-weight: 500;
            transition: all 0.3s ease;
            cursor: pointer;
            
            &:hover {
              background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.05));
              border-color: #5a6fd8;
              transform: translateY(-2px);
              box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
            }
            
            i {
              font-size: 18px;
              color: #667eea;
            }
            
            .image-url {
              font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
              font-size: 12px;
              color: #6c757d;
              background: rgba(255, 255, 255, 0.7);
              padding: 2px 6px;
              border-radius: 4px;
              border: 1px solid #dee2e6;
              word-break: break-all;
              max-width: 200px;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
            }
          }
        }
      }
      
      .article-stats {
        padding: 16px;
        background: rgba(102, 126, 234, 0.15);
        border-radius: 12px;
        border: 1px solid rgba(102, 126, 234, 0.2);
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
        position: relative;
        overflow: hidden;
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        
        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.15) 100%);
          opacity: 0.8;
        }
        
        .stat-item {
          display: flex;
          align-items: center;
          gap: 8px;
          color: #667eea;
          font-size: 14px;
          font-weight: 500;
          position: relative;
          z-index: 1;
          
          i {
            color: #667eea;
            font-size: 16px;
            text-shadow: 0 1px 2px rgba(102, 126, 234, 0.3);
          }
        }
      }
    }
    
    // 文章图片
    .article-images {
      padding: 0 20px 20px;
      
      .images-title {
        margin: 0 0 16px;
        font-size: 18px;
        font-weight: 700;
        color: #2c3e50;
        border-left: 4px solid #67c23a;
        padding-left: 12px;
        background: linear-gradient(90deg, rgba(103, 194, 58, 0.05), transparent);
      }
      
      .images-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
        
        .image-item {
          border-radius: 12px;
          overflow: hidden;
          box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
          transition: transform 0.3s ease, box-shadow 0.3s ease;
          position: relative;
          cursor: pointer;
          
          &::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 1;
          }
          
          &:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
            
            &::before {
              opacity: 1;
            }
            
            .image-overlay {
              opacity: 1;
            }
          }
          
          .content-image {
            width: 100%;
            height: 160px;
            object-fit: cover;
            position: relative;
            z-index: 0;
            transition: transform 0.3s ease;
          }
          
          .image-overlay {
            position: absolute;
            top: 8px;
            right: 8px;
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 2;
          }
          
          .image-error {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 160px;
            background: #f8f9fa;
            color: #6c757d;
            border: 2px dashed #dee2e6;
            border-radius: 8px;
            
            i {
              font-size: 32px;
              margin-bottom: 8px;
              color: #adb5bd;
            }
            
            p {
              margin: 0;
              font-size: 14px;
              font-weight: 500;
            }
          }
        }
      }
    }
  }
}

// 滑入动画
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

// 淡入动画
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.article-management {
  padding: 20px;
  transition: margin-right 0.3s ease;
  
  // 当弹窗显示时，主内容区域向左压缩
  &.dialog-open {
    margin-right: 520px; // 500px弹窗宽度 + 20px间距
  }
  
  // 当弹窗全屏时，主内容区域不需要压缩
  &.dialog-open.fullscreen {
    margin-right: 0;
  }
}

.search-section {
  margin-bottom: 20px;
}

.article-list {
  .pagination-wrapper {
    margin-top: 20px;
    text-align: right;
  }

  // 统一文章表格每列左右间距（使用深度选择器穿透 scoped）
  ::v-deep .el-table {
    table-layout: fixed; // 避免因内容变化导致列宽不一致

    // 统一表头与表体单元格的左右内边距，形成一致的列间距
    .el-table__header th .cell,
    .el-table__body td .cell {
      padding-left: 16px !important;
      padding-right: 16px !important;
    }
  }
}

// AI审核弹窗样式
.ai-review-content {
  .no-results {
    text-align: center;
    padding: 40px 20px;
    color: #909399;
    
    i {
      font-size: 48px;
      margin-bottom: 16px;
      display: block;
    }
    
    p {
      margin: 0;
      font-size: 16px;
    }
  }
  
  .review-summary {
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
    
    p {
      margin: 0;
      color: #0369a1;
      font-weight: 500;
    }
  }
  
  .review-list {
    max-height: 400px;
    overflow-y: auto;
    
    .review-item {
      margin-bottom: 16px;
      padding: 16px;
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      transition: all 0.3s ease;
      
      &:hover {
        border-color: #3b82f6;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
      }
      
      .review-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        
        .article-title {
          font-weight: 600;
          color: #1f2937;
          flex: 1;
          margin-right: 12px;
        }
      }
      
      .review-message {
        strong {
          color: #374151;
          font-weight: 600;
        }
        
        p {
          margin: 8px 0 0;
          color: #6b7280;
          line-height: 1.6;
          padding: 12px;
          background: #f9fafb;
          border-radius: 6px;
          border-left: 3px solid #3b82f6;
        }
      }
    }
  }
}

// 响应式设计
@media (max-width: 1200px) {
  .article-management.dialog-open {
    margin-right: 0;
  }
  
  .right-side-detail-panel {
    width: 100vw;
  }
}

@media (max-width: 768px) {
  .right-side-detail-panel {
    width: 100vw;
    
    .detail-header {
      padding: 12px 16px;
      
      .header-title {
        font-size: 18px;
      }
    }
    
    .detail-content {
      .article-body {
        margin: 12px;
        padding: 16px;
        
        .article-title {
          font-size: 18px;
        }
        
        .article-content {
          .content-text {
            font-size: 14px;
            
            .markdown-h1 {
              font-size: 20px;
            }
            
            .markdown-h2 {
              font-size: 18px;
            }
            
            .markdown-h3 {
              font-size: 16px;
            }
          }
        }
      }
      
      .article-images {
        padding: 0 12px 12px;
        
        .images-title {
          font-size: 16px;
        }
        
        .images-list {
          .image-item {
            .content-image {
              height: 120px;
            }
            
            .image-error {
              height: 120px;
            }
          }
        }
      }
    }
  }
}

@media (max-width: 480px) {
  .right-side-detail-panel {
    width: 100vw;
    
    .detail-header {
      padding: 10px 12px;
      
      .header-left .back-btn {
        padding: 8px 12px;
        font-size: 14px;
      }
      
      .header-title {
        font-size: 16px;
      }
      
      .header-right .action-btn {
        width: 36px;
        height: 36px;
        padding: 8px;
      }
    }
    
    .detail-content {
      .article-image {
        height: 180px;
      }
      
      .article-body {
        margin: 8px;
        padding: 12px;
        
        .article-title {
          font-size: 16px;
        }
        
        .article-meta {
          padding: 8px;
          
          .category-tag,
          .status-tag {
            font-size: 10px;
            padding: 2px 8px;
          }
          
          .publish-time {
            font-size: 11px;
          }
        }
        
        .article-content {
          .content-text {
            font-size: 13px;
            
            .markdown-h1 {
              font-size: 18px;
            }
            
            .markdown-h2 {
              font-size: 16px;
            }
            
            .markdown-h3 {
              font-size: 15px;
            }
          }
        }
        
        .article-stats {
          padding: 12px;
          
          .stat-item {
            font-size: 12px;
            
            i {
              font-size: 14px;
            }
          }
        }
      }
      
      .article-images {
        padding: 0 8px 8px;
        
        .images-title {
          font-size: 14px;
        }
        
        .images-list {
          gap: 8px;
          
          .image-item {
            .content-image {
              height: 100px;
            }
            
            .image-error {
              height: 100px;
              
              i {
                font-size: 24px;
              }
              
              p {
                font-size: 12px;
              }
            }
          }
        }
      }
    }
  }
}